var CompanyAddress = {
	getAddressGrid: function() {
		ajax({
			  url: baseURL + "company/address",
			  cache: false,
			  type: "POST",
			  data: $('#ajax_form').serialize(),
			  async: false,
			  dataType: 'html',
			  success: function(data) {
				  $('#gridAddress').html(data);
			  }
			});
	},
	
	processAddress: function() {
		ajax({
		  url: baseURL + "company/address/" + ($('#idaddress').val() ? 'update' : 'insert'),
		  cache: false,
		  type: "POST",
		  data: $('#ajax_form').serialize(),
		  async: false,
		  dataType: 'script'
		});
		
		return false;
	},
	
	editAddress: function(idaddress) {
		$.facebox(function() {
			ajax({
			  url: baseURL + "company/address/edit/" + idaddress,
			  cache: false,
			  type: "POST",
			  async: false,
			  dataType: 'html',
			  success: function(data) { $.facebox(data) }
			});
		});
		
		return false;
	},
	
	deleteAddress: function(idaddress) {
		ajax({
			  url: baseURL + "company/address/delete",
			  cache: false,
			  type: "POST",
			  data: 'id=' + idaddress,
			  async: false,
			  dataType: 'script'
			});
			
			return false;
	}
};